package com.czy.thymeleafdemo.controller;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Description : TODO
 * @Author : chris_cai@enable-ets.com
 * @Since : 2018年06月05日
 */

@Controller
public class TestController {
    @Value("${name:czy}")
    private String name;

    @GetMapping("/hello")
    public String index(Model model) {
        Map<String,String> map = new HashMap<>();
        map.put("name","小李");
        map.put("age","23");
        map.put("gender","男");
        map.put("height","178");
        model.addAttribute("map",map);
        model.addAttribute("str","hello world!");
        model.addAttribute("act","asghdjasasasdasdasddddddddddddddddddddddddddddddddddddddddddddd");
        model.addAttribute("jrebel","test");
        model.addAttribute("czy","test");
//        System.out.println(name);
        return "hello";
    }

}
